import java.util.ArrayList;
import java.util.HashMap;

import com.jchy.graph.Edge;

import com.jchy.graph.Vertex;
import com.jchy.graph.Graph;
import com.jchy.graph.core.GraphItData;
import com.jchy.graph.core.Pixel;


public class GraphItDataLoadData {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		GraphItData gid = new GraphItData();
		gid.open("/home/chyjm/workspace/Graph/data/simplegraph.txt");
		Graph aGraph = gid.getAGraph();
		HashMap<Vertex,Pixel> map = gid.getMap();
		ArrayList<Vertex> vertices = aGraph.getVertices();
		System.out.println("Vertices");
		for(Vertex v : vertices)
		{
			Pixel p = map.get(v);
			if(p == null) System.out.println(v + " no location");
			else System.out.println(v + " X: " + p.getX() + " Y: " + p.getY());
		}
		
		ArrayList<Edge> edges = aGraph.getEdges();
		System.out.println("Edges");
		for(Edge e : edges)
		{
			System.out.println(e);
		}
		
		gid.castCircle(200, 200);
		map = gid.getMap();

		System.out.println("Vertices after casting to Circle");
		for(Vertex v : vertices)
		{
			Pixel p = map.get(v);
			if(p == null) System.out.println(v + " no location");
			else System.out.println(v + " X: " + p.getX() + " Y: " + p.getY());
		}
	}

}
